// pages/settings/scanSetting/scanSetting.js
Page({
  data: {
    fontSize_item: [
      { name: 24, value: '小号', checked: '{{font1}}' },
      { name: 30, value: '中号', checked: '{{font2}}' },
      { name: 36, value: '大号', checked: '' },  
    ],
    fontBgc_item: [
      { name: '#FFFFBB', value: '羊皮纸', checked: '' },
      { name: '#CCFF99', value: '护眼绿', checked: '' },
      { name: '', value: '无颜色', checked: 'true' },
    ]

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    //判断现在的字体
    var that = this
    wx.getStorage({
      key: 'fontSetting',
      success: function (res) {
        if (res.data === 24) {
          that.setData({
            font1: true,
            font2: null,
            font3: null
          })
        }
        else if (res.data === 40) {
          that.setData({
            font1: null,
            font2: true,
            font3: null
          })
        }
        else if (res.data === 32) {
          that.setData({
            font1: null,
            font2: null,
            font3: true
          })
        }

      },
    })

  },
  radioChangeOne: function (event) {
    console.log(event.detail.value)
    wx.setStorage({
      key: 'fontSetting',
      data: event.detail.value

    })
  },
  radioChangeTwo: function (event) {
    console.log(event.detail.value)
    wx.setStorage({
      key: 'fontBgc',
      data: event.detail.value

    })
  }

})